﻿@model List<Introduction>
@{
    ViewBag.Title = "Danh mục Giới thiệu chung";
}
<div class="main-content-inner">
    <div class="breadcrumbs" id="breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="ace-icon fa fa-home home-icon"></i>
                <a href="@Url.Action("index", "home")">Home</a>
            </li>
            <li class="active">Danh mục Giới thiệu chung</li>
        </ul>
    </div>
     <div class="page-content">


        <div class="page-header">
            <h1>Danh mục Giới thiệu chung
								
            </h1>
        </div>
        <!-- /.page-header -->
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="row">
                    <div class="col-xs-12">
                        @using (Html.BeginForm(null, null, FormMethod.Post, new { @id = "manageForm" }))
                        {
                            @Html.AntiForgeryToken()
                            <input type="hidden" name="id" id="IntroductionId" />
                            <input type="hidden" name="IsActive" id="IsActive" />
                            <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                <thead>
                                    <tr>
                                        
                                        <th>Ảnh</th>
                                        <th>Tên mục</th>
                                        <th>Tiêu đề</th>
                                        <th class="hidden-480">
                                            <i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>
                                            Ngày tạo

                                        </th>
                                        <th class="hidden-480">Status</th>
                                        <th></th>
                                    </tr>
                                </thead>

                                <tbody>
                                    @if (Model != null && Model.Count > 0)
                                    {
                                        foreach (Introduction item in Model)
                                        {
                                        <tr>

                                            <td style="text-align:center">
                                                <img width="300" height="200" alt="300x200" src="@item.IntroductionImage">
                                                
                                            </td>
                                            <td>@item.IntroductionName</td>
                                            <td>@item.IntroductionTitle</td>
                                            <td class="hidden-480">@item.CreateDate.ToString("dd/MM/yyyy")</td>
                                            <th class="hidden-480">
                                                @if (item.IsActive)
                                                {
                                                    <span class="label label-sm label-success">Active</span>
                                                }
                                                else
                                                {
                                                    <span class="label label-sm label-danger">Inactive</span>
                                                }
                                            </th>
                                            <td>
                                                <div class="hidden-sm hidden-xs btn-group">

                                                    <a class="btn btn-xs btn-info" href="@Url.Action("Update", "Introduction", new { Id = item.IntroductionId })" >
                                                        <i class="ace-icon fa fa-pencil bigger-120"></i>
                                                    </a>

                                                    <a href="javascript:" class="btn btn-xs btn-danger" onclick="Delete('@item.IntroductionId','@item.IntroductionId')">

                                                        <i class="ace-icon fa fa-trash-o bigger-120"></i>
                                                    </a>


                                                </div>

                                                <div class="hidden-md hidden-lg">
                                                    <div class="inline pos-rel">
                                                        <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
                                                            <i class="ace-icon fa fa-cog icon-only bigger-110"></i>
                                                        </button>

                                                        <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
                                                            <li>
                                                                <a href="#" class="tooltip-info" data-rel="tooltip" title="Promote">
                                                                    <span class="green">
                                                                        <i class="ace-icon fa fa-arrow-circle-up bigger-120"></i>
                                                                    </span>
                                                                </a>
                                                            </li>

                                                            <li>
                                                                <a href="#" class="tooltip-success" data-rel="tooltip" title="Demote">
                                                                    <span class="yellow">
                                                                        <i class="ace-icon fa fa-arrow-circle-down bigger-120"></i>
                                                                    </span>
                                                                </a>
                                                            </li>
                                                            <li>
                                                                <a href="#" class="tooltip-success" data-rel="tooltip" title="ChangePass">
                                                                    <span class="blue">
                                                                        <i class="ace-icon fa fa-pencil bigger-120"></i>
                                                                    </span>
                                                                </a>
                                                            </li>
                                                            <li>
                                                                @if (item.IsActive)
                                                                {
                                                                    <a href="#" class="tooltip-error" data-rel="tooltip" title="Lock">
                                                                        <span class="red">

                                                                            <i class="ace-icon fa fa-lock bigger-120"></i>

                                                                        </span>
                                                                    </a>
                                                                }
                                                                else
                                                                {
                                                                    <a href="#" class="tooltip-error" data-rel="tooltip" title="UnLock">
                                                                        <span class="red">

                                                                            <i class="ace-icon fa fa-unlock bigger-120"></i>

                                                                        </span>
                                                                    </a>
                                                                }
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        }
                                    }

                                </tbody>
                            </table>
                        }
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <a href="@Url.Action("Create")" class="btn btn-success">Tạo mới</a>
                        </div>
                    </div>
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </div>
</div>
<script type="text/javascript">
   
    function Delete(id, title) {
        bootbox.confirm("Đồng ý xóa danh mục: " + title + " ?", function (result) {
            if (result) {
                $("#IntroductionId").val(id);
                $('#manageForm').attr('action', '@(Url.Action("Delete"))').submit();
            }
        });
    }
</script>
<script type="text/javascript">
    jQuery(function ($) {
        $('#dynamic-table')
            .dataTable({
                bAutoWidth: false,
                "aoColumns": [
                    null, null, null, null, null,
                    { "bSortable": false }
                ],
                "aaSorting": [],
            });
    })
</script>
<script type="text/javascript">
    setAdminCurrentUrl('@Url.Action("Search", "Introduction")');
</script>